package alfred.mdp;

import org.zeromq.ZFrame;

import static alfred.mdp.utils.Utils.asByteArray;

/**
 */
public class Majordomo {

    public static final String DEFAUL_ENCODING = "UTF-8";

    /**
     * six bytes, representing MDP/Client v0.1
     */
    public final static ZFrame PROTOCOL_CLIENT_V = new ZFrame(asByteArray("MDPC01"));

    /**
     * six bytes, representing MDP/Worker v0.1
     */
    public final static ZFrame PROTOCOL_WORKER_V = new ZFrame(asByteArray("MDPW01"));
    public final static ZFrame EMPTY = new ZFrame(new byte[]{});

    public static final int HB_INTERVAL = 2500;
    public static final int HB_LIVENESS = 3;
    public static final int CHECK_INTERVAL = 2500;

    public static class Worker {
        public final static ZFrame READY = new ZFrame(new byte[]{0x01});
        public final static ZFrame REQUEST = new ZFrame(new byte[]{0x02});
        public final static ZFrame REPLY = new ZFrame(new byte[]{0x03});
        public final static ZFrame HEARTBEAT = new ZFrame(new byte[]{0x04});
        public final static ZFrame DISCONNECT = new ZFrame(new byte[]{0x05});
    }
}
